<?php
namespace App\Admin\Models;
use Common\BaseModel;
class HomeAd extends BaseModel
{
    protected $res;
    protected $redis_key="admin_";
    public function initialize()
    {
        parent::initialize();
        $this->setSource('view_home_ad');
    }

    public function find_list($ids=''){
        $condition="";
        if(!empty($ids)){
            $condition = "id in($ids)";
        }
        $list = $this::find(array(
            $condition,
            'order' => 'sort desc'
        ));
        return $list;
    }

    public function find_by_id_obj($id){
        return $this->findFirstById($id);
    }

}
